maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=py3-syrupy
_pyname=${pkgname/py3-/}
pkgver=4.7.2
pkgrel=0
pkgdesc="The sweeter pytest snapshot plugin"
url="https://tophat.github.io/syrupy"
arch="noarch"
license="Apache-2.0"
depends="python3 py3-pytest py3-colored"
makedepends="py3-poetry-core py3-gpep517"
checkdepends="py3-invoke py3-pytest-benchmark"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tophat/syrupy/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest --snapshot-update
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/$_pyname-$pkgver-py3-none-any.whl
}

sha512sums="
b04c62d5577c4ca63dc6fde3e0fe205a513551081d6e79db4bc56a56a91305689ed69b6e4364e964a706442fb61f847aec82a8a2409b6621d472602fb0c03e2d  py3-syrupy-4.7.2.tar.gz
"
